﻿using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.TaskPlatform.Domain.Entity
{
    public class NodePerformanceMonitorEntity
    {
        /// <summary>
        /// 节点ID
        /// </summary>
        [JsonProperty("nodeid")]
        public string Nodeid { get; set; }
        /// <summary>
        /// 模块id
        /// </summary>
        [JsonProperty("taskmoduleId")]
        public string TaskmoduleId { get; set; }
        /// <summary>
        /// 模块CPU Processor Time
        /// </summary>
        [JsonProperty("nodecpuprocessortime")]
        public decimal Nodecpuprocessortime { get; set; }
        /// <summary>
        /// 模块内存占用
        /// </summary>
        [JsonProperty("nodememory")]
        public decimal Nodememory { get; set; }

    }
    public sealed class NodePerformanceMonitorEntityMapper : ClassMapper<NodePerformanceMonitorEntity>
    {
        public NodePerformanceMonitorEntityMapper()
        {
            Table("node_performance_monitor");
            Map(f => f.Nodeid).Key(KeyType.Assigned).Column("nodeid");
            Map(f => f.TaskmoduleId).Key(KeyType.Assigned).Column("taskmoduleId");
            Map(f => f.Nodecpuprocessortime).Column("nodecpuprocessortime");
            Map(f => f.Nodememory).Column("nodememory");

        }
    }
}